//-----------------------------------------------------------
//
//-----------------------------------------------------------
class LightsaberPickup extends KFWeaponPickup;

auto state Pickup 
{
	function Touch(Actor Other) 
	{
		local Inventory Copy;

		if ( KFHumanPawn(Other) != none && !CheckCanCarry(KFHumanPawn(Other)) ) {
			return;
		}

		// If touched by a player pawn, let him pick this up.
		if ( ValidTouch(Other) ) 
		{
			Copy = SpawnCopy(Pawn(Other));
			AnnouncePickup(Pawn(Other));
			SetRespawn();
	
			if ( Copy != None ) 
			{
				Copy.PickupFunction(Pawn(Other));
			}
	
			if ( MySpawner != none && KFGameType(Level.Game) != none ) 
			{
				KFGameType(Level.Game).WeaponPickedUp(MySpawner);
			}
	
			if ( KFWeapon(Copy) != none ) 
			{
				KFWeapon(Copy).SellValue = SellValue;
				KFWeapon(Copy).bPreviouslyDropped = bDropped;
				Lightsaber(Copy).ForceCD();
	
				if ( !bPreviouslyDropped && KFWeapon(Copy).bIsTier3Weapon &&
					Pawn(Other).Controller != none && Pawn(Other).Controller != DroppedBy ) 
				{
					KFWeapon(Copy).Tier3WeaponGiver = DroppedBy;
				}
			}
		}
	}
}

state FallingPickup 
{
	function Touch(Actor Other) 
	{
		local Inventory Copy;
		if ( KFHumanPawn(Other) != none && !CheckCanCarry(KFHumanPawn(Other)) ) 
		{
			return;
		}
	
		// If touched by a player pawn, let him pick this up.
		if ( ValidTouch(Other) ) 
		{
			Copy = SpawnCopy(Pawn(Other));
			AnnouncePickup(Pawn(Other));
			SetRespawn();
	
			if ( Copy != None ) 
			{
				Copy.PickupFunction(Pawn(Other));
			}

			if ( MySpawner != none && KFGameType(Level.Game) != none ) 
			{
				KFGameType(Level.Game).WeaponPickedUp(MySpawner);
			}
	
			if ( KFWeapon(Copy) != none ) 
			{
				KFWeapon(Copy).SellValue = SellValue;
				KFWeapon(Copy).bPreviouslyDropped = bDropped;
				Lightsaber(Copy).ForceCD();
	
				if ( !bPreviouslyDropped && KFWeapon(Copy).bIsTier3Weapon &&
					Pawn(Other).Controller != none && Pawn(Other).Controller != DroppedBy ) 
				{
					KFWeapon(Copy).Tier3WeaponGiver = DroppedBy;
				}
			}
		}
	}
}

defaultproperties
{
     Weight=4.000000
     cost=20000
     PowerValue=60
     SpeedValue=60
     RangeValue=-21
     Description="An incredibly hot sword."
     ItemName="Lightsaber"
     ItemShortName="Lightsaber"
     showMesh=SkeletalMesh'Lightsaber_A.Weapon_Lightsaber_3rdP'
     CorrespondingPerkIndex=4
     InventoryType=Class'PerksSimHostOrg.Lightsaber'
     PickupMessage="You got the Lightsaber."
     PickupSound=Sound'KF_AxeSnd.Axe_Pickup'
     PickupForce="AssaultRiflePickup"
     StaticMesh=StaticMesh'Lightsaber_SM.Weapon_Lightsaber.Lightsaber_Pickup'
     CollisionRadius=27.000000
     CollisionHeight=5.000000
}
